/*
 * lines.c
 *
 *  Created on: 2017年4月10日
 *      Author: zhikang.peng
 */

#include "system-api.h"
#include <stdio.h>

void HariMain(void) {
	char *buf, s[20];
	int win, i;

	api_initmalloc();
	buf = api_malloc(160 * 100);
	win = api_openwindos(buf, 160, 100, -1, "lines");
	for (i = 0; i < 8; i++) {
		api_drawLine(win + 1, 8, 26, 77, i * 9 + 26, i);
		api_drawLine(win + 1, 88, 26, i * 9 + 88, 89, i);
	}
	sprintf(s, "%d", win);
	api_putstr(s);
	api_refrechwin(win, 6, 26, 154, 90);
	for (;;) {
		if (api_getKeyboardData(1) == 0x0a) {
			api_closeWindos(win);
			break;
		}
	}
	api_end();
}
